/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.sale.entity;

import com.jeeplus.modules.customer.entity.CustomerInformation;
import javax.validation.constraints.NotNull;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.List;
import com.google.common.collect.Lists;

import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;

/**
 * 销售任务Entity
 * @author 卢经纬
 * @version 2018-06-30
 */
public class SaleTask extends DataEntity<SaleTask> {
	
	private static final long serialVersionUID = 1L;
	private String taksName;		// 任务名称
	private CustomerInformation customerInformation;		// 客户名称
	private String contractAmount;		// 合同额
	private Date completeTime;		// 完成日期
	private String packetMode;		// 发包方式
	private String industry;		// 所属行业
	private String taskType;		// 任务类型
	private String competitor;		// 竞争对手
	private String taskDescription;		// 项目概况描述
	private Integer state;		// 项目状态（0：未发布；1：正常发布；2：已关闭）
	private String finishReason;		// 关闭原因
	private String concerned;		// 相关人员
	private List<SaleContacts> saleContactsList = Lists.newArrayList();		// 子表列表
	private List<SalePartner> salePartnerList = Lists.newArrayList();		// 子表列表
	private List<SaleRecord> saleRecordList = Lists.newArrayList();		// 子表列表
	
	public SaleTask() {
		super();
	}

	public SaleTask(String id){
		super(id);
	}

	@ExcelField(title="任务名称", align=2, sort=7)
	public String getTaksName() {
		return taksName;
	}

	public void setTaksName(String taksName) {
		this.taksName = taksName;
	}
	
	@NotNull(message="客户名称不能为空")
	@ExcelField(title="客户名称", fieldType=CustomerInformation.class, value="customerInformation.name", align=2, sort=8)
	public CustomerInformation getCustomerInformation() {
		return customerInformation;
	}

	public void setCustomerInformation(CustomerInformation customerInformation) {
		this.customerInformation = customerInformation;
	}
	
	@ExcelField(title="合同额", align=2, sort=9)
	public String getContractAmount() {
		return contractAmount;
	}

	public void setContractAmount(String contractAmount) {
		this.contractAmount = contractAmount;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd")
	@NotNull(message="完成日期不能为空")
	@ExcelField(title="完成日期", align=2, sort=10)
	public Date getCompleteTime() {
		return completeTime;
	}

	public void setCompleteTime(Date completeTime) {
		this.completeTime = completeTime;
	}
	
	@ExcelField(title="发包方式", align=2, sort=11)
	public String getPacketMode() {
		return packetMode;
	}

	public void setPacketMode(String packetMode) {
		this.packetMode = packetMode;
	}
	
	@ExcelField(title="所属行业", align=2, sort=12)
	public String getIndustry() {
		return industry;
	}

	public void setIndustry(String industry) {
		this.industry = industry;
	}
	
	@ExcelField(title="任务类型", align=2, sort=13)
	public String getTaskType() {
		return taskType;
	}

	public void setTaskType(String taskType) {
		this.taskType = taskType;
	}
	
	@ExcelField(title="竞争对手", align=2, sort=14)
	public String getCompetitor() {
		return competitor;
	}

	public void setCompetitor(String competitor) {
		this.competitor = competitor;
	}
	
	@ExcelField(title="项目概况描述", align=2, sort=15)
	public String getTaskDescription() {
		return taskDescription;
	}

	public void setTaskDescription(String taskDescription) {
		this.taskDescription = taskDescription;
	}

	@ExcelField(title="项目状态（0：未发布；1：正常发布；2：已关闭）", align=2, sort=16)
	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}
	
	@ExcelField(title="关闭原因", align=2, sort=17)
	public String getFinishReason() {
		return finishReason;
	}

	public void setFinishReason(String finishReason) {
		this.finishReason = finishReason;
	}
	
	@ExcelField(title="相关人员", align=2, sort=18)
	public String getConcerned() {
		return concerned;
	}

	public void setConcerned(String concerned) {
		this.concerned = concerned;
	}
	
	public List<SaleContacts> getSaleContactsList() {
		return saleContactsList;
	}

	public void setSaleContactsList(List<SaleContacts> saleContactsList) {
		this.saleContactsList = saleContactsList;
	}
	public List<SalePartner> getSalePartnerList() {
		return salePartnerList;
	}

	public void setSalePartnerList(List<SalePartner> salePartnerList) {
		this.salePartnerList = salePartnerList;
	}
	public List<SaleRecord> getSaleRecordList() {
		return saleRecordList;
	}

	public void setSaleRecordList(List<SaleRecord> saleRecordList) {
		this.saleRecordList = saleRecordList;
	}
}